<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script src="vue.js"></script>
<body>
    <input type="button" value="获取哈希" id="btn">
    <script>
        var btn = document.getElementById('btn');
        btn.onclick = function(){
            console.log(window.location.hash);
        };
        window.onhashchange = function(){
            console.log(window.location.hash);
        }
    </script>
</body>
</html>